#!/bin/bash

file=$1

if [ -z "${file}" ] ; then	
	echo "please provide file ond cmd line"
	exit 1
fi

hash=$(mktemp)

md5sum $@ > $hash

groovy $file

while [ 1 -eq 1 ];
do
	if md5sum -c $hash 2>&1 | grep -q NOT ; then		
		groovy $file
		md5sum $@ > $hash
	else 
		sleep 1;
	fi
done
		